package com.uniview.mvpdemo.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.uniview.mvpdemo.view.fragment.Main2Fragment;

/**
 * Created by Lenovo on 2017/4/24.
 */

public class Main2Adpter extends FragmentPagerAdapter {

    private String[] Tabs = {"左边", "中间", "右边"};

    public Main2Adpter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return Main2Fragment.newInstance(Tabs[position]);
    }

    @Override
    public int getCount() {
        return Tabs.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
//        return super.getPageTitle(position);
        return Tabs[position];
    }
}
